<?php
//测试控制器类
class IndexController extends Controller{
    //动作方法
	public function index(){
		if(IS_POST){
			$db= K("News");
			if($db->create()){
				$db->add();
				$this->success('添加成功','index');
			}else{
				$this->error($db->error,'index');
			}
		}else{
			$this->display();
		}
	}
	public function code(){
		$code = new code();
		$code->show();
	}
}